<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>router-apply</title>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but router-apply doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <a onclick="go('/home')">首页</a>
    <a onclick="go('/about')">关于</a>
    <div id="test"></div>
    <script>
      window.addEventListener('popstate', function (event) {
        go(location.pathname);
      });
      function go(path) {
        history.pushState({}, '', path);
        test.innerHTML = path;
      }
    </script>
  </body>
</html>
